Set up the environment for running CellChat V2 by defining key variables. Specify the working directory (output_dir) which is optional, and load a Seurat object (seurat_obj) containing single-cell RNA sequencing data is loaded. The species is set to either “human” or “mouse,” as CellChat V2 supports only these two species. The metadata column (annotation_column) is defined to specify the cell type or other annotation labels, ensuring the analysis runs with the correct input data.
# Set the working directory
output_dir <- "../scDown/tests"
# output_dir <- "/Users/chunhui/BCH_projects/scDown_pipeline/scDown/tests"
# Seurat object
seurat_obj <- readRDS("../scDown/inst/extdata/10X43_1_spliced_unspliced.rds")
seurat_obj <- readRDS("/Users/chunhui/BCH_projects/scDown_pipeline/scDown/inst/extdata/10X43_1_spliced_unspliced.rds")
# Define the species: either "mouse" or "human", since CellChat and PPI database only support these two species for now
species <- "mouse"
# Metadata cell type column
annotation_column <- "clusters"
# Number of most significant pathways to visualize
top_n = 10We run CellChat using the entire dataset, including all cells and cell types, without specifying any particular conditions or groups. However, it is also possible to run CellChat for specific treatments, or groups by defining ‘group_column’. Additionally, pairwise comparisons can be performed to analyze differences between these groups. A demonstration of how to set up and run these comparisons will be provided in a later session.
# Run CellChat V2
run_cellchatV2(seurat_obj = seurat_obj,
output_dir = output_dir,
annotation_column = annotation_column,
species = species)Running Time: ~2 minutes
This plot visualizes the overall interactions between different cell types in the dataset. The circle plot shows the interactions and their weights, providing a high-level view of the communication network across all cells. It helps to understand the general communication patterns between cell types in the context of signaling pathways.
The scatter plot displays the signaling roles of different cell types in the communication network. It offers a visual representation of how cells are involved in the overall signaling, highlighting their contributions and interactions with other cells in the network.
This heatmap shows the incoming and outgoing signals between cell types, summarizing the interactions at a global level. It helps to identify which cell types are the primary senders and receivers of signals in the network, aiding in the understanding of signaling flow and patterns.
This aggregated circle plot highlights the most significant pathways by visualizing the weighted interactions between cell types for each pathway. It helps in understanding the strength of interactions for key pathways and how they contribute to the overall signaling network.
This heatmap shows the signaling strength for a specific pathway across various cell types. It visualizes how different cell types contribute to or receive signals for that particular pathway, providing insights into the role of each cell type in the signaling network.
This violin plot visualizes the distribution of gene expression levels for a specific pathway across different cell types. The width of the violin plot indicates the density of gene expression values at various levels, providing insights into the variability and spread of gene expression within the pathway. It helps to identify which cell types have higher or lower expression levels for genes associated with the pathway, giving a clearer understanding of how these genes are regulated in different cell types.
#> Pathway APP:
This bubble plot displays the ligand-receptor pairs involved in signaling for a specific pathway. Each bubble represents a ligand-receptor interaction, with the size of the bubble indicating the strength of the interaction. It helps to identify the most prominent ligand-receptor pairs that mediate the pathway-specific cell communication.
#> Pathway APP:
In this step, we run CellChat with user-defined groups. The group information is specified in the “age.days.” column of the metadata, which contains two distinct values: 35 and 12. By setting the group_column to “age.days.”, CellChat will analyze the cell communication network separately for these two age groups, allowing for comparison between them. This approach enables the exploration of differences in cell-to-cell interactions based on age, providing insights into how communication networks vary across distinct groups.
# Group information column
group_column <- "age.days."
# Run CellChat V2
run_cellchatV2(seurat_obj = seurat_obj,
output_dir = output_dir,
annotation_column = annotation_column,
species = species,
group_column = group_column)Running Time: ~4 minutes
The plots generated in this analysis represent cell-to-cell interactions for both age groups (35 and 12). For instance, the circle view shows the signaling strength across the two age groups, providing a comparative analysis of how the cell communication network differs between them.
#> Age group: 12
#> Age group: 35
Similarly, for pathway views visualize the interactions for both age groups, highlighting the heatmaps and ligand-receptor pairs involved in signaling and their relative strengths in each group. These visualizations allow for a side-by-side comparison of the cell communication dynamics across different age groups.
Heatmap
#> Age group: 12
#> Age group: 35
The bubble plot of ligand-receptor pairs
#> Age group: 12
#> Age group: 35
Our pipeline also allows for a more focused analysis by selecting specific cell types of interest. In this example, the variable celltypes_of_interest is defined to include a list of selected cell types, such as “Granule immature”, “Radial Glia-like”, “Granule mature”, and “Microglia”. By setting the annotation_selected parameter to these cell types, CellChat V2 is run specifically on this subset, performing cell-to-cell communication analysis and visualization only for the selected cell types. This feature enables users to concentrate on particular cell populations, making the analysis more targeted and relevant to specific biological questions.
# Cell types of interest. (Optional, 'ALL' by default)
celltypes_of_interest <- c("Granule immature", "Radial Glia-like", "Granule mature", "Neuroblast", "Microglia", "Cajal Retzius", "OPC", "Cck-Tox")
# Run CellChat V2
run_cellchatV2(seurat_obj = seurat_obj,
output_dir = output_dir,
annotation_column = annotation_column,
annotation_selected = celltypes_of_interest,
species = species,
group_column = group_column)Running Time: ~3 minutes
Our pipeline also supports pairwise comparisons between different groups using the comparison_conditions parameter. In this example, the comparison_conditions variable is defined as a list of conditions to compare, such as comparing age groups “35” and “12”. By specifying the group_cmp parameter, CellChat V2 performs the analysis and visualization specifically for these pairwise conditions, allowing for a direct comparison of cell-to-cell communication networks between the selected groups. This feature is useful for investigating how the communication patterns differ between different conditions, treatments, or time points.
# Pairwise condition comparisons.
comparison_groups <- list(c("35", "12"))
# Run CellChat V2
run_cellchatV2(seurat_obj = seurat_obj,
output_dir = output_dir,
annotation_column = annotation_column,
species = species,
group_column = group_column,
group_cmp = comparison_groups)Running Time: ~4 minutes
The rankNet plot compares the relative importance of different signaling pathways between groups, such as age group 35 vs. 12. When stacked = TRUE (left panel), the x-axis shows “Relative information flow”, which represents the proportional contribution of each pathway to the total communication between cell types. This normalization allows for a comparison of how each pathway ranks relative to others within the group. When stacked = FALSE (right panel), the x-axis shows “Information flow”, which indicates the absolute communication strength for each pathway without normalization. This provides the raw magnitude of signaling for each pathway. The rankNet plot, therefore, helps to identify which pathways are most influential in mediating communication between the groups, allowing for insights into age-related differences in cell-to-cell signaling.
The signaling changes scatter plot visualizes differences in cell-to-cell signaling between conditions, such as comparing age groups (e.g., 35 vs. 12). The x-axis shows the differential outgoing interaction strength, which quantifies the difference in signaling strength for outgoing interactions, while the y-axis represents the differential incoming interaction strength, measuring the difference in signaling strength for incoming interactions for each pathway. The plot helps identify pathways with significant changes in communication, with points farther along the x-axis indicating stronger signaling. The color of the points indicates which group the pathway is specific to. This scatter plot provides a clear overview of pathways where signaling is differentially regulated between groups, helping to identify key pathways that drive communication specific to either age group or are shared by both.
We also provide a side-by-side plot to visualize cell-to-cell communication strength for each cell type when comparing different groups. This plot allows for a direct comparison of how communication strength varies across cell types between the age groups, highlighting any differences or similarities in signaling. By displaying the data side by side, it becomes easier to identify which cell types exhibit stronger or weaker communication in one group compared to the other, providing a clearer understanding of how age-related changes may influence cell-to-cell interactions.
We also provide a function that allows you to specify a pathway of interest to plot signaling strength, heatmaps, scatter plots, as well as LR gene expression violin plots and communication probability bubble plots. This is useful if there are a specific set of pathways you’re interested in that are not among the top_n most significant pathways already visualized. (Note: You must complete the run_cellchatV2 process before running the cellchatV2_path_visu function.)
This document outlines a pipeline for analyzing cell-to-cell communication using CellChat V2. The pipeline begins by defining key variables, such as the working directory, Seurat object, species, and metadata for cell type annotations. It runs CellChat V2 on the entire dataset to explore global interactions across all cells and generates visualizations like aggregated circle plots, scatter plots, heatmaps, and violin plots, which highlight signaling strength, interaction patterns, and ligand-receptor pairs.
Additionally, the pipeline supports focused analysis by selecting specific cell types or comparing user-defined groups (e.g., age groups 35 and 12). Pairwise comparisons are made to examine differences in cell signaling, with rankNet plots and signaling change scatter plots identifying differentially regulated pathways. Side-by-side plots also allow for direct comparison of communication strength across cell types between groups, offering insights into age-related signaling changes. This pipeline provides a comprehensive tool for exploring and comparing cell communication networks.
The analysis was performed on a machine with the following specifications: